<template>
	<div class="heightMax order">
		<!-- <div class="roleTopBox">
			<div class="listName" style="margin-bottom: 0;">
				<div>
					<el-button type="primary" size="muni" @click="submitData('add_all')" v-loading='allSubmit' :disabled="submitBtn"
					 v-if="isUser == 21">全部授权</el-button>
					<el-button type="danger" size="mini" :disabled="deleteBtn" @click='delteFn' v-if="!isRoleControl">删除</el-button>
					<el-button type="primary" size="mini" @click="submitData('no_add_all')" v-loading='submitBtn' :disabled="allSubmit">保存</el-button>
					<el-button size="mini" @click='backRouter'>返回</el-button>
				</div>
			</div>
		</div> -->
		<div class="roleBottomBox">
			<vueScroll>
				<div class="treeBox">
					<!-- 特种设备列表 -->
					<div class="treeItem" v-loading='tableLoading' :style="{width:isRoleControl ? '100%' : '49%'}">
						<div class="listName">
							<div class="listNameBox"><i></i><span class="font14">特种设备列表</span></div>
							<el-select style='width: 110px;' v-model="eleLib" size="mini"  placeholder="商业平台/基础库" @change="table1EleChange"
							 class='selectKu'>
								<el-option v-for="item in eleLibArr" :key="item.value" :label="item.name" :value="item.value">
								</el-option>
							</el-select>
							<el-popover placement="bottom" width="400" trigger="click" v-model="visible">
								<el-row :gutter="10" class='currentRow currentRow1'>
									<el-col :span="11" :offset='1'>
										<span>设备注册代码:</span>
										<el-input v-model="left_table_register_code" size="mini" clearable placeholder="请输入设备注册代码"></el-input>
									</el-col>
									<el-col :span="11" :offset='1'>
										<span>内部编号:</span>
										<el-input v-model="left_table_internal_no" size="mini" clearable placeholder="请输入内部编号"></el-input>
									</el-col>
								</el-row>
								<el-row :gutter="10" class='currentRow currentRow1'>
									<el-col :span="11" :offset='1'>
										<span>使用单位:</span>
										<el-select :remote-method="findUserUnit" filterable remote v-model="left_table_property_com" size="mini"
										 :loading="userLoading" clearable placeholder="请选择使用单位">
											<el-option v-for="item in left_table_property_comArr" :key="item.id" :label="item.name" :value="item.name">
											</el-option>
										</el-select>
									</el-col>
									<el-col :span="11" :offset='1' v-if="role == 0">
										<span>维保单位:</span>
										<el-select :remote-method="findMainUnit" filterable remote v-model="left_table_maintain_com" size="mini"
										 clearable placeholder="请选择维保单位" :loading="compLoading">
											<el-option v-for="item in left_table_maintain_comArr" :key="item.id" :label="item.name" :value="item.name">
											</el-option>
										</el-select>
									</el-col>
									<div class="btnBox">
										<el-button type="primary" size="mini" @click="moviesTableEnter">确定</el-button>
										<el-button size="mini" @click="visible = false">关闭</el-button>
									</div>
								</el-row>
								<el-button slot="reference" type="primary" class='btnMargin' size="mini">查询条件</el-button>
							</el-popover>
							<el-button style='margin-left: 5px;' type="primary" size="mini" @click="submitData('add_all')" v-loading='allSubmit'
							 :disabled="submitBtn" v-if="isUser == 21">全部授权</el-button>
							<div v-if="isRoleControl">
								<el-button type="primary" size="mini" style='margin-left: 5px;' @click="submitData('no_add_all')" v-loading='submitBtn'
								 :disabled="allSubmit">保存</el-button>
								<el-button size="mini" @click='backRouter(2)'>返回</el-button>
							</div>
						</div>
						<div class="tableBox">
							<vueScroll>
								<el-table :data="tableData" highlight-current-row ref="moviesTable" @row-click="rowClick" style="width: 100%"
								 border header-row-class-name='tableHeader' @selection-change="AllSelection" :row-key='getKey'>
									<el-table-column type="index" class="over" fixed>
									</el-table-column>
									<el-table-column type="selection" min-width="50" :reserve-selection='true' fixed>
									</el-table-column>
									<el-table-column label="设备注册代码" min-width="150">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.register_code" placement="top">
												<span class="speSpan">{{scope.row.register_code}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
									<el-table-column label="内部编号">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.internal_no" placement="top">
												<span class="speSpan">{{scope.row.internal_no}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
									<el-table-column label="使用单位" property="username">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.property_company_name" placement="top">
												<span class="speSpan">{{scope.row.property_company_name}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
									<el-table-column label="维保单位">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.maintain_company_name" placement="top">
												<span class="speSpan">{{scope.row.maintain_company_name}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
								</el-table>
								<!-- 分页器 -->
								<div class="pag">
									<el-pagination :current-page="page" :page-sizes="[10, 20, 30, 40]" :page-size="page_size" layout="total, sizes, prev, pager, next, jumper"
									 :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange">
									</el-pagination>
								</div>
							</vueScroll>
						</div>
					</div>
					<!-- 已授权特种设备列表 -->
					<div class="treeItem" style="margin-left: 1%;" v-loading='tableLoading1' v-if="!isRoleControl">
						<div class="listName">
							<div class="listNameBox"><i></i><span class="font14">已授权特种设备列表</span></div>
							<el-select style='width: 110px;' v-model="eleLib1" size="mini"  placeholder="商业平台/基础库" @change="table1EleChange1"
							 class='selectKu'>
								<el-option v-for="item in eleLibArr" :key="item.value" :label="item.name" :value="item.value">
								</el-option>
							</el-select>
							<el-popover placement="bottom" width="400" trigger="click" v-model="visible1">
								<el-row :gutter="10" class='currentRow currentRow1'>
									<el-col :span="11" :offset='1'>
										<span>设备注册代码:</span>
										<el-input v-model="left_table_register_code1" size="mini" clearable placeholder="请输入设备注册代码"></el-input>
									</el-col>
									<el-col :span="11" :offset='1'>
										<span>内部编号:</span>
										<el-input v-model="left_table_internal_no1" size="mini" clearable placeholder="请输入内部编号"></el-input>
									</el-col>
								</el-row>
								<el-row :gutter="10" class='currentRow currentRow1'>
									<el-col :span="11" :offset='1'>
										<span>使用单位:</span>
										<el-input size="mini" v-model="left_table_property_com1" clearable placeholder="请输入使用单位"></el-input>
										<!-- <el-select :remote-method="findUserUnit1" filterable remote v-model="" size="mini"
										 :loading="userLoading1" >
											<el-option v-for="item in left_table_property_comArr1" :key="item.id" :label="item.name" :value="item.name">
											</el-option>
										</el-select> -->
									</el-col>
								<!-- 	<el-col :span="11" :offset='1' v-if="role == 0">
										<span>维保单位:</span>
										<el-select :remote-method="findMainUnit1" filterable remote v-model="left_table_maintain_com1" size="mini"
										 clearable placeholder="请选择维保单位" :loading="compLoading1">
											<el-option v-for="item in left_table_maintain_comArr1" :key="item.id" :label="item.name" :value="item.name">
											</el-option>
										</el-select>
									</el-col> -->
									<div class="btnBox">
										<el-button type="primary" size="mini" @click="moviesTableEnter1">确定</el-button>
										<el-button size="mini" @click="visible1 = false">关闭</el-button>
									</div>
								</el-row>
								<el-button slot="reference" type="primary" class='btnMargin' size="mini">查询条件</el-button>
							</el-popover>
							<el-button type="danger" size="mini" style='margin-left: 5px;' :disabled="deleteBtn" @click='delteFn' v-if="!isRoleControl">删除</el-button>
							<el-button type="primary" size="mini" @click="submitData('no_add_all')" v-loading='submitBtn' :disabled="allSubmit">保存</el-button>
							<el-button size="mini" @click='backRouter'>返回</el-button>
						</div>
						<div class="tableBox">
							<vueScroll>
								<el-table :data="tableData2" highlight-current-row ref="moviesTableTwo" @row-click="rowClickSecond" border
								 header-row-class-name='tableHeader' @selection-change="selectChange">
									<el-table-column type="index" class="over" fixed>
									</el-table-column>
									<el-table-column type="selection" min-width="50" fixed>
									</el-table-column>
									<el-table-column label="设备注册代码" min-width="150">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.register_code" placement="top">
												<span class="speSpan">{{scope.row.register_code}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
									<el-table-column label="内部编号">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.internal_no" placement="top">
												<span class="speSpan">{{scope.row.internal_no}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
									<el-table-column label="使用单位" property="username">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.property_company_name" placement="top">
												<span class="speSpan">{{scope.row.property_company_name}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
									<el-table-column label="维保单位">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.maintain_company_name" placement="top">
												<span class="speSpan">{{scope.row.maintain_company_name}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
								</el-table>
								<div class="pag">
									<el-pagination :current-page="page1" :page-sizes="[10, 20, 30, 40]" :page-size="page_size1" layout="total, sizes, prev, pager, next, jumper"
									 :total="total1" @size-change="handleSizeChange1" @current-change="handleCurrentChange1">
									</el-pagination>
								</div>
							</vueScroll>
						</div>
					</div>
					<!-- 待授权特种设备列表 -->
					<div class="treeItem" style="width: 100%;margin-top: 10px;">
						<div class="listName">
							<div class="listNameBox"><i></i><span class="font14">待授权特种设备列表</span></div>
						</div>
						<div class="tableBox">
							<vueScroll>
								<el-table :data="tableData3" highlight-current-row ref="moviesTableThree" @row-click="rowClickThree" border
								 header-row-class-name='tableHeader'>
									<el-table-column type="index" class="over" fixed>
									</el-table-column>
									<el-table-column type="selection" min-width="50" fixed>
									</el-table-column>
									<el-table-column label="设备注册代码" min-width="150">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.register_code" placement="top">
												<span class="speSpan">{{scope.row.register_code}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
									<el-table-column label="内部编号">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.internal_no" placement="top">
												<span class="speSpan">{{scope.row.internal_no}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
									<el-table-column label="使用单位" property="username">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.property_company_name" placement="top">
												<span class="speSpan">{{scope.row.property_company_name}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
									<el-table-column label="维保单位">
										<template slot-scope="scope">
											<el-tooltip class="item" effect="dark" :content="scope.row.maintain_company_name" placement="top">
												<span class="speSpan">{{scope.row.maintain_company_name}}</span>
											</el-tooltip>
										</template>
									</el-table-column>
									<el-table-column label="操作">
										<template slot-scope="scope">
											<span class="eleDanger font13 cursor" @click="removeList(scope.$index, scope.row)">删除</span>
										</template>
									</el-table-column>
								</el-table>
							</vueScroll>
						</div>
					</div>
				</div>
			</vueScroll>
		</div>
	</div>
</template>

<script>
	import {
		loadFn,
		axiosPost,
		axiosGet,
		axiosDelete,
		axiosPut,
		AllLoading,
		axiosChange
	} from "@/common.js";
	export default {
		mounted() {
			if (this.orgType !== 10) {
				this.getAllLift() //获取所有电梯信息
			} else {
				this.getJianGuan() //组织机构监管单位权限
			}
			if (this.role == 0) {
				this.mainComFind()
				// this.mainComFind1()
				// this.findUserFind1()
				this.findUserFind()
			} else {
				// this.findUserFind1()
				this.findUserFind()
			}
		},
		data() {
			return {
				page: 1,
				page_size: 10,
				page1: 1,
				page_size1: 10,
				total: 0,
				total1: 0,
				tableLoading: false,
				tableLoading1: false,
				submitBtn: false,
				deleteBtn: true,
				tableData: [],
				tableData2: [],
				tableData3: [],
				selectData: [],
				isRoleControl: false,
				getChoseLift: false,
				allSubmit: false,
				visible: false,
				left_table_register_code: '',
				left_table_internal_no: '',
				left_table_maintain_com: '',
				left_table_property_com: '',
				left_table_maintain_comArr: [],
				left_table_property_comArr: [],
				compQuery: '',
				userQuery: '',
				compLoading: false,
				userLoading: false,
				visible1: false,
				left_table_register_code1: '',
				left_table_internal_no1: '',
				left_table_maintain_com1: '',
				left_table_property_com1: '',
				left_table_maintain_comArr1: [],
				left_table_property_comArr1: [],
				compQuery1: '',
				userQuery1: '',
				compLoading1: false,
				userLoading1: false,
				eleLib: 0,
				eleLib1: 0,
				eleLibArr: [{
						value: 0,
						name: '商业平台库'
					},
					{
						value: 1,
						name: '基础库'
					}
				]
			}
		},
		computed: {
			role() {
				if (localStorage.role) {
					return JSON.parse(localStorage.role).id
				} else {
					return ''
				}
			},
			orgType() { //组织机构权限
				if (localStorage.org_type) {
					return JSON.parse(localStorage.org_type).id
				} else {
					return ''
				}
			},
			roleOperation() {
				if (localStorage.roleOperation) {
					return JSON.parse(localStorage.roleOperation).id
				} else {
					return ''
				}
			},
			isUser() {
				if (localStorage.isUser) {
					return JSON.parse(localStorage.isUser).isTrue
				} else {
					return ''
				}
			}
		},
		methods: {
			//特种设备列表商业库/基础库切换
			table1EleChange(res) {
				console.log(res)
				localStorage.eleLib = JSON.stringify({id:res})
				this.eleLib1 = res
				this.page1 = 1
				this.page_size1 = 3
				this.page = 1
				this.page_size = 3
				this.tableData3 = []
				if (this.orgType !== 10) {
					this.getAllLift() //获取所有电梯信息
				} else {
					this.getJianGuan() //组织机构监管单位权限
				}
			},
			//特种设备列表商业库/基础库切换
			table1EleChange1(res) {
				console.log(res)
				this.page1 = 1
				this.page_size1 = 3
				this.getChoseLiftMessage()
			},
			//维保单位搜索
			findMainUnit(query) {
				this.compQuery = query
				this.mainComFind()
			},
			//维保单位搜索
			mainComFind() {
				let params = {
					page_size_count: 30,
					key_words: this.compQuery
				}
				this.compLoading = true
				let url = ''
				if (this.role == 40) {
					url = '/user/supervise/company/'
				} else {
					url = '/user/company/?company_type=100'
				}
				axiosGet(url, params, (res) => {
					this.compLoading = false
					if (res.code == 0) {
						this.left_table_maintain_comArr = res.detail.results
					} else {
						this.$message.error(res.detail.result)
					}
				})
			},
			//维保单位搜索
			findMainUnit1(query) {
				this.compQuery1 = query
				this.mainComFind1()
			},
			//维保单位搜索
			mainComFind1() {
				let params = {
					page_size_count: 30,
					key_words: this.compQuery1
				}
				this.compLoading1 = true
				axiosGet('/user/company/?company_type=100', params, (res) => {
					this.compLoading1 = false
					if (res.code == 0) {
						this.left_table_maintain_comArr1 = res.detail.results
					} else {
						this.$message.error(res.detail.result)
					}
				})
			},
			//使用单位搜索
			findUserUnit(query) {
				this.userQuery = query
				this.findUserFind()
			},
			//使用单位搜索
			findUserFind() {
				let params = {
					page_size_count: 30,
					key_words: this.userQuery
				}
				this.userLoading = true
				axiosGet('/user/company/?company_type=300', params, (res) => {
					this.userLoading = false
					if (res.code == 0) {
						this.left_table_property_comArr = res.detail.results
					} else {
						this.$message.error(res.detail.result)
					}
				})
			},
			//使用单位搜索
			findUserUnit1(query) {
				this.userQuery1 = query
				this.findUserFind1()
			},
			//使用单位搜索
			findUserFind1() {
				let params = {
					page_size_count: 30,
					key_words: this.userQuery1
				}
				this.userLoading1 = true
				axiosGet('/user/company/?company_type=300', params, (res) => {
					this.userLoading1 = false
					if (res.code == 0) {
						this.left_table_property_comArr1 = res.detail.results
					} else {
						this.$message.error(res.detail.result)
					}
				})
			},
			getKey(row) {
				return row.id
			},
			//特种设备列表查询条件
			moviesTableEnter() {
				this.page =  1
				this.page_size = 3
				this.page1 =  1
				this.page_size1 = 3
				this.visible = false
				if (this.orgType !== 10) {
					this.getAllLift() //获取所有电梯信息
				} else {
					this.getJianGuan() //组织机构监管单位权限
				}
			},
			moviesTableEnter1() {
				this.page1 =  1
				this.page_size1 = 3
				this.visible1 = false
				this.getChoseLiftMessage()
			},
			//特种设备列表选中变化
			AllSelection(res) {
				console.log(res)
				this.tableData3 = res
			},
			//监管单位接口
			getJianGuan() {
				this.tableLoading = true
				let params = {
					page: this.page,
					page_size_count: this.page_size,
					register_code: this.left_table_register_code,
					internal_no: this.left_table_internal_no,
					maintain_company_name: this.left_table_maintain_com,
					property_company_name: this.left_table_property_com,
				}
				if (this.eleLib) {
					params.lift = 1
				}
				this.isRoleControl = false
				axiosGet('/user/supervise/', params, (res) => {
					this.tableLoading = false
					if (res.code == 0) {
						this.total = res.detail.count
						this.tableData = res.detail.results
						this.getChoseLiftMessage()
					} else {
						this.$message.error(res.detail.result)
					}
				})
			},
			//删除选中授权电梯
			delteFn() {
				this.$confirm('此操作将永久删除已授权电梯, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					let newCodes = this.selectData.map((item) => {
						return item.register_code
					})
					let data = ''
					let url = ''
					if (this.orgType != 10) {
						data = {
							organization: this.roleOperation,
							register_codes: newCodes
						}
						url = '/user/organization/mycode/'
					} else {
						data = {
							register_codes: newCodes
						}
						if(this.eleLib1 == 1){
							data.lift = 1
						}
						url = '/user/supervise/modify/'
					}
					axiosDelete(url, data, (res) => {
						if (res.code == 0) {
							this.$message({
								type: 'success',
								message: '删除成功!'
							});
							this.getChoseLiftMessage()
						} else {
							this.$message.error(res.detail.result)
						}
					})
				}).catch(() => {});
			},
			//获取所有电梯信息
			getAllLift() {
				this.tableLoading = true
				let params = {
					page: this.page,
					page_size_count: this.page_size,
					organization: this.roleOperation,
					register_code: this.left_table_register_code,
					internal_no: this.left_table_internal_no,
					maintain_company_name: this.left_table_maintain_com,
					property_company_name: this.left_table_property_com,
				}
				if (this.eleLib) {
					params.lift = 1
				}
				let url = ''
				if (this.isUser == 11 || this.isUser == 12 || this.isUser == 99) { //11 12新增/编辑角色的自选电梯权限
					url = '/user/role/elevator/'
					this.isRoleControl = true //不展示右侧已选择
					if(this.isUser == 99){
						this.isRoleControl = false
					}
				} else if (this.isUser == 1 || this.isUser == 2) {
					url = '/user/user/elevator/'
					this.isRoleControl = true
				} else { //21 组织下部门的电梯权限
					url = '/user/organization/code/'
					this.isRoleControl = false
					this.getChoseLift = true
				}
				axiosGet(url, params, (res) => {
					this.tableLoading = false
					if (res.code == 0) {
						this.total = res.detail.count
						this.tableData = res.detail.results
						if (this.getChoseLift) {
							this.getChoseLiftMessage()
						}
					} else {
						this.$message.error(res.detail.result)
					}
				})
			},
			//获取已选择的电梯信息
			getChoseLiftMessage() {
				this.tableLoading1 = true
				let params = ''
				let url = ''
				if (this.orgType !== 10) { //组织下部门   角色下的权限接口
					params = {
						page: this.page1,
						page_size_count: this.page_size1,
						organization: this.roleOperation,
						basic:this.eleLib1
					}
					url = '/user/organization/mycode/'
				} else { //组织机构监管单位权限
					params = {
						page: this.page1,
						page_size_count: this.page_size1,
						supervised: 1
					}
					url = '/user/supervise/'
				}
				if (this.eleLib1) {
					params.lift = 1
				}
				params.register_code = this.left_table_register_code1
				params.internal_no = this.left_table_internal_no1
				params.maintain_company_name = this.left_table_maintain_com1
				params.property_company_name = this.left_table_property_com1
				axiosGet(url, params, (res) => {
					this.tableLoading1 = false
					if (res.code == 0) {
						this.total1 = res.detail.count
						this.tableData2 = res.detail.results
					} else {
						this.$message.error(res.detail.result)
					}
				})

			},
			//保存
			submitData(newValue) {
				console.log(this.tableData3)
				let register_codesArr = this.tableData3.map((item) => {
					return item.register_code
				})
				//授权全部
				if (!this.isRoleControl) { //说明此时是不展示右侧已选择的 不调用接口保存
					let data = ''
					let url = ''
					if (this.orgType != 10) { //组织下部门接口
						data = {
							organization: this.roleOperation,
							register_codes: register_codesArr,
							lift : this.eleLib.toString()
						}
						url = '/user/organization/mycode/'
					} else { //   组织下监管单位接口
						data = {
							register_codes: register_codesArr,
							lift : this.eleLib.toString()
						}
						url = '/user/supervise/modify/'
					}
					if (newValue == 'add_all') {
						data.add_all = 1
						data.register_codes = []
						this.allSubmit = true
					} else {
						this.submitBtn = true
					}
					axiosPost(url, data, (res) => {
						this.submitBtn = false
						this.allSubmit = false
						if (res.code == 0) {
							this.$message({
								type: 'success',
								message: '操作成功'
							})
							// this.backRouter()
							this.$refs.moviesTable.clearSelection()
							this.getChoseLiftMessage()
						} else {
							this.$message.error(res.detail.result)
						}
					})
				} else { //角色权限
					localStorage.choseLiftData = JSON.stringify({
						data: register_codesArr
					})
					this.$store.state.choseLiftData = register_codesArr
					this.backRouter()
				}
			},
			backRouter(value = 1) {
				if (value == 2) {
					localStorage.choseLiftData = JSON.stringify({
						data: []
					})
				}
				let obj = ''
				if (this.isUser == 1) {
					obj = {
						name: '新增用户',
						router: '/MainView/SystemManagement/AddRoleCount'
					}
				} else if (this.isUser == 2) {
					obj = {
						name: '编辑用户',
						router: '/MainView/SystemManagement/ComplieRoleCount'
					}
				} else if (this.isUser == 11) {
					obj = {
						name: '新增角色',
						router: '/MainView/SystemManagement/AddRoleManagment'
					}
				} else if (this.isUser == 12) {
					obj = {
						name: '编辑角色',
						router: '/MainView/SystemManagement/ComplieRoleManagement'
					}
				} else if (this.isUser == 21) {
					obj = {
						name: '部门管理',
						router: '/MainView/SystemManagement/DivisionalManagement'
					}
				} else if (this.isUser == 31 && this.orgType == 10 ) {
					obj = {
						name: '组织管理',
						router: '/MainView/SystemManagement/InstitutionalFramework'
					}
				}
				this.$store.commit('GOTAGROUTER', obj)
				localStorage.removeItem('org_type')
			},
			//单行点击
			rowClick(row, column) {
				this.$refs.moviesTable.toggleRowSelection(row)
			},
			//已授权特种设备点击
			rowClickSecond(row, column) {
				this.$refs.moviesTableTwo.toggleRowSelection(row)
			},
			//待授权特种设备点击
			rowClickThree(row, column) {
				this.$refs.moviesTableThree.toggleRowSelection(row)
			},
			//多选变化
			selectChange(res) {
				this.selectData = res
				if (res.length != 0) {
					this.deleteBtn = false
				} else {
					this.deleteBtn = true
				}
			},
			//
			handleSizeChange(size) {
				this.page_size = size
				if (this.orgType !== 10) {
					this.getAllLift()
				} else {
					this.getJianGuan()
				}
			},
			handleCurrentChange(page) {
				this.page = page
				if (this.orgType !== 10) {
					this.getAllLift()
				} else {
					this.getJianGuan()
				}
			},
			//已选电梯
			handleSizeChange1(size) {
				this.page_size1 = size
				this.getChoseLiftMessage()
			},
			handleCurrentChange1(page) {
				this.page1 = page
				this.getChoseLiftMessage()
			},
			//删除待选中的数据
			removeList(index, row) {
				this.tableData3.splice(index, 1)
			}
		},
		beforeDestroy() {
			
		},
	}
</script>

<style lang="less" scoped>
	.listName {
		display: flex;
		justify-content: inherit;
		text-align: left;
		// height: 25px;
		align-items: center;
		width: 100%;
		margin-bottom: 15px;

		.listNameBox {
			height: 100%;
			display: flex;
			align-items: center;

			i {
				width: 3px;
				height: 60%;
				background: #2d8cf0;
				margin: 10px 5px;
				margin-left: 0;
			}
		}
	}

	.treeBox {
		width: 100%;
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;

		.treeItem {
			width: 50%;
			// max-height: 300px;
		}
	}

	.roleTopBox {
		padding: 15px;
		background: #fff;
		box-sizing: border-box;
		height: 9%;
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}

	.roleBottomBox {
		background: #fff;
		height: 100%;
		margin-top: 5px;
		padding: 15px;
		box-sizing: border-box;
	}

	.tableBox {
		height: 80% !important;
	}

	.btnMargin {
		margin-left: 15px;
	}

	.currentRow {
		.el-col {
			display: flex;
			flex-direction: row;
			align-items: center;
			margin-bottom: 5px;

			span {
				width: 150px;
				display: inline-block;
				text-align: right;
				margin-right: 5px;
			}
		}

		.btnBox {
			text-align: center;
			margin-top: 40px;
		}
	}

	.selectKu {
		width: 180px;
		margin-left: 15px;
	}
</style>
